<!-- 客户端技巧心得详情页 -->
<template>
  <div id="reportDetail" v-show="loading">
    <div class="title">项目名称：{{ data.prjName }}</div>
    <div class="intro">
      <span>{{ data.declareDate }}</span>
    </div>
    <div
      class="content"
      v-html="data.prjMainInfo"
      v-if="data.prjMainInfo"
    ></div>
    <div class="content center" v-else>暂无数据</div>
    <div class="statement">
      免责声明：本终端所载数据仅供参考，若数据有误，以交易所发布数据为准，不对您构成投资建议。
    </div>
  </div>
</template>

<script>
import { infoFund } from "../api/index";
import { getUrlParams } from "../script/utils";
const { id, code } = getUrlParams();
export default {
  data() {
    return {
      data: {},
      loading: false,
    };
  },
  mounted() {
    this.getNewDetail();
  },
  methods: {
    async getNewDetail() {
      this.loading = true;
      await infoFund({ stockCode: code }).then((back) => {
        if (back.status == 1) {
          this.loading = true;
          let data = back.data.project;
          if (!data) return;
          data.forEach((item) => {
            if (item.id == id) return (this.data = item);
          });
        }
      });
    },
  },
};
</script>
<style>
.content img {
  display: block;
  max-width: 90% !important;
}
</style>
<style lang="scss" scoped>
@import "../style/reset.css";
#reportDetail {
  margin: 0 auto;
  padding: 24px 28px;
  max-width: 1200px;
  img {
    max-width: 100%;
  }
  .title {
    color: #333333;
    font-size: 20px;
    font-weight: bold;
    line-height: 42px;
    text-align: center;
  }
  .intro {
    text-align: center;
    color: #666666;
    line-height: 42px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
    span {
      margin-right: 5px;
    }
  }
  .content {
    color: #333333;
    font-size: 16px;
    font-weight: 400;
    line-height: 28px;
    word-break: break-all;
    // white-space: pre-wrap;换行
    &.center {
      text-align: center;
      padding: 50px 0 30px;
      color: #999999;
    }
  }
  .statement {
    margin-top: 20px;
    height: 46px;
    line-height: 46px;
    border-top: 1px solid #e0e0e0;
    color: #999999;
    font-size: 15px;
    font-weight: 500;
  }
  .showTime {
    text-align: center;
    font-size: 0.5rem;
    font-weight: bold;
    color: #333333;
    padding-top: 0.8rem;
  }
}
</style>
